<?xml version="1.0"?>

<st-source>
<time-stamp>From VisualWorks® NonCommercial, 7.6 of March 3, 2008 on April 15, 2009 at 1:12:53 pm</time-stamp>


<class>
<name>ItemPriceVoltilityReport</name>
<environment>SupplyChain</environment>
<super>UI.SimpleDialog</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>data orders item </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category></category>
<attributes>
<package>SupplyChain</package>
</attributes>
</class>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>SupplyChain.ItemPriceVoltilityReport class</class-id> <category>interface specs</category>

<body package="SupplyChain" selector="windowSpec">windowSpec
	"Tools.UIPainter new openOnClass: self andSelector: #windowSpec"

	&lt;resource: #canvas&gt;
	^#(#{UI.FullSpec} 
		#window: 
		#(#{UI.WindowSpec} 
			#label: 
			#(#{Kernel.UserMessage} 
				#key: #EasyChart2 
				#defaultString: 'Supplier Quantity Report' 
				#catalogID: #BGOK ) 
			#min: #(#{Core.Point} 20 20 ) 
			#bounds: #(#{Graphics.Rectangle} 640 512 905 703 ) ) 
		#component: 
		#(#{UI.SpecCollection} 
			#collection: #(
				#(#{UI.ChartViewSpec} 
					#layout: #(#{Graphics.LayoutFrame} 5 0 5 0 -5 1 -5 1 ) 
					#model: #data 
					#chartType: #BG_LineChartView 
					#dataSeries: 
					#(#{UI.ChartDataSpec} 
						#series: #(
							#(#{UI.ChartDataSetSpec} 
								#name: 'Data1' ) 
							#(#{UI.ChartDataSetSpec} 
								#isData: false 
								#name: 'Labels' ) ) ) 
					#yAxis: 
					#(#{UI.ChartingValueAxisSpec} 
						#scale: 
						#(#{UI.ChartingScaleSpec} 
							#invert: true ) ) ) ) ) )</body>
</methods>

<methods>
<class-id>SupplyChain.ItemPriceVoltilityReport class</class-id> <category>instance creation</category>

<body package="SupplyChain" selector="new">new
	^super new initialize.</body>
</methods>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<comment>
<class-id>SupplyChain.ItemPriceVoltilityReport</class-id>
<body>SupplierQuantityReport shows a bar chart of quantities of items provided for a specific Item/Supplier by POS Location.

Instance Variables:
	Chart1	&lt;ValueHolder&gt;	A Bar Chart
	retailers	&lt;OrderedCollection&gt;A list of retailers
	suppliers	&lt;OrderedCollection&gt;	 A list of suppliers

</body>
</comment>

<methods>
<class-id>SupplyChain.ItemPriceVoltilityReport</class-id> <category>aspects</category>

<body package="SupplyChain" selector="data">data
	" Test information is commented out below the temp variable assignments	"
	| outer xValue inner yValue  |
	" i1 i2 i3 i4 i5 i6 i7 i8 o1 o2 o3 o4 o5 |

   	i1 := Item named: 'Video Game' sku:'89X999'.
   	i2 := Item named: 'TV' sku: '99Z837'.
   	i3 := Item named: 'VCR' sku: '54Y3632'.
   	i4 := Item named: 'PC' sku: '01P6373'.
   	i5 := Item named: 'Laptop' sku: '11F4732'.
   	i6 := Item named: 'TV' sku: '99Z837'.
   	i7 := Item named: 'TV' sku: '99Z837'.
   	i8 := Item named: 'TV' sku: '99Z837'.

	item:= i2.

	i2 buyPrice: 10.
	o1:= Order new.
	o1 add: i1.
	o1 add: i2.
	o1 add: i3.
	o1 add: i4.
	o1 add: i5.

	o2:= Order new.
	o2 add: i1.
	o2 add: i3.
	o2 add: i4.
	o2 add: i5.	

	i6 buyPrice: 6.
	o3:= Order new.
	o3 add: i6.
	o3 add: i5.
	o3 add: i4.
	

	i7 buyPrice: 15.
	o4:= Order new.
	o4 add: i3.
	o4 add: i7.

	i8 buyPrice: 14.
	o5:= Order new.
	o5 add: i5.
	o5 add: i4.
	o5 add: i3.
	o5 add: i8.
	o5 add: i1.

	
	
	orders add: o1.
	orders add: o2.
	orders add: o3.
	orders add: o4.
	orders add: o5.

"

	outer:= OrderedCollection new.
	xValue := 0.

	orders do: [:i |
		i items do: [:j |
			(j name = item name) ifTrue: [
				inner:= OrderedCollection new.
				yValue := j buyPrice.
				inner add: yValue.
			 	inner add: xValue.
			 	xValue := xValue + 1.
			 	outer add: inner.
			].
		].
	].
	
	^outer.</body>
</methods>

<methods>
<class-id>SupplyChain.ItemPriceVoltilityReport</class-id> <category>accessing</category>

<body package="SupplyChain" selector="item">item
	
	^item</body>

<body package="SupplyChain" selector="item:">item: anItem
	
	item := anItem.
	^self</body>

<body package="SupplyChain" selector="orders">orders

	^orders</body>

<body package="SupplyChain" selector="orders:">orders: anObject

	orders := anObject.
	^self</body>
</methods>

<methods>
<class-id>SupplyChain.ItemPriceVoltilityReport</class-id> <category>initialize-release</category>

<body package="SupplyChain" selector="initialize">initialize
	"Initialize a newly created instance. This method must answer the receiver."

	super initialize.
	" *** Edit the following to properly initialize instance variables ***"
	orders := OrderedCollection new.
	item := Item new.
	
	" *** And replace this comment with additional initialization code *** "
	^self</body>
</methods>

</st-source>
